#include <iostream>
#include<stdio.h>
#include<graphics.h>
#include<conio.h>
int main()
{
	float Pi = 3.14159;
	initgraph(1200, 800);
	setbkcolor(RGB(128, 128, 128));
	cleardevice();
	int circleX = 300;
	int circleY = 300;
	int radius = 200;

	int i;
	float offset;
	float totaloffset = 0;
    for (circleX = 200; circleX < 1200; circleX = circleX + 400)
	{
		for (circleY = 200; circleY < 800; circleY = circleY + 400)
		{
			float h = rand() % 180;
			COLORREF color1 = HSVtoRGB(h, 0.9, 0.8);
			COLORREF color2 = HSVtoRGB(h + 180, 0.9, 0.8);
			for (radius = 200; radius > 0; radius -= 50)
			{
				int left = circleX - radius;
				int top = circleY - radius;
				int right = circleX + radius;
				int bottom = circleY + radius;
				for (i = 0; i < 20; i++)
				{
					offset = i * Pi / 10 + totaloffset;
					setfillcolor(RGB(0, 240, 220));
					setfillcolor(color1);
					solidpie(left, top, right, bottom, offset, 2 * Pi / 60 + offset);
					setfillcolor(RGB(255, 255, 255));
					solidpie(left, top, right, bottom, 2 * Pi / 60 + offset, 3 * Pi / 60 + offset);
					setfillcolor(RGB(200, 0, 0));
					setfillcolor(color2);
					solidpie(left, top, right, bottom, 3 * Pi / 60 + offset, 5 * Pi / 60 + offset);
					setfillcolor(RGB(0, 0, 0));
					solidpie(left, top, right, bottom, 5 * Pi / 60 + offset, 6 * Pi / 60 + offset);
				}
                totaloffset = totaloffset + Pi / 20;
                }
                }
                }
                
                _getch();
	return 0;


}
